package ihm;

import ihm.classifier.ClassifierPanel;
import ihm.start.StartPanel;
import ihm.tfidf.TfIdfRight;

import java.awt.event.KeyEvent;

import javax.swing.JComponent;
import javax.swing.JTabbedPane;



public class MainTabbedPane extends JTabbedPane {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public MainTabbedPane(){
		createStartTab();
		createTfIdfTab();
		createClassifierTab();
	}

	private void createStartTab(){
		JComponent StartTab = new StartPanel();
		addTab("CLASSES", null, StartTab, "CLASSES");
		setMnemonicAt(0, KeyEvent.VK_1);
	}

	private void createTfIdfTab(){
		JComponent TfIdfTab = new TfIdfRight();
		addTab("MAT DOC/MOT", null, TfIdfTab, "MAT DOC/MOT");
		setMnemonicAt(1, KeyEvent.VK_2);
		this.setEnabledAt(indexOfTab("MAT DOC/MOT"), false); 	
	}

	private void createClassifierTab(){
		JComponent ClassTab = new ClassifierPanel();
		addTab("CLASSIFIEUR", null, ClassTab, "CLASSIFIEUR");
		setMnemonicAt(2, KeyEvent.VK_3);
		this.setEnabledAt(indexOfTab("CLASSIFIEUR"), false); 
	}

	public void SetTabEnabled(){
		this.setEnabledAt(indexOfTab("CLASSIFIEUR"), true);
		this.setEnabledAt(indexOfTab("MAT DOC/MOT"), true);
	}

}
